// TaskOrgSet.cpp : implementation of the CTaskOrgSet class
//

#include "stdafx.h"
#include "TaskOrg.h"
#include "TaskOrgSet.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CTaskOrgSet implementation

IMPLEMENT_DYNAMIC(CTaskOrgSet, CDaoRecordset)

CTaskOrgSet::CTaskOrgSet(CDaoDatabase* pdb)
	: CDaoRecordset(pdb)
{
	//{{AFX_FIELD_INIT(CTaskOrgSet)
	m_ID = 0;
	m_ParentTaskID = 0;
	m_StartDateTime = _T("");
	m_StartPerson = _T("");
	m_Topic = _T("");
	m_Concerns = _T("");
	m_Priority = 0;
	m_Responsible = _T("");
	m_Description = _T("");
	m_Notes = _T("");
	m_WaitFor = _T("");
	m_Deadline = _T("");
	m_WarnBefore = 0;
	m_WarnPeriod = 0;
	m_EndDateTime = _T("");
	m_EndPerson = _T("");
	m_Status = _T("");
	m_nFields = 17;
	//}}AFX_FIELD_INIT
	m_nDefaultType = dbOpenDynaset;
}

CString CTaskOrgSet::GetDefaultDBName()
{
	CFileDialog	fd( TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "*.mdb", NULL);
	if (fd.DoModal()!=IDOK)
		return "*.*";
	return fd.GetPathName().GetBuffer(8192);
	//"mdb", "errdet.txt", OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter8, NULL);
	//return _T("taskorg.mdb");
	//return _T("C:\\Program Files\\Microsoft Visual Studio\\MyProjects\\TaskOrg\\taskorg.mdb");
}


CString CTaskOrgSet::GetDefaultSQL()
{
	return _T("[Tasks]");
}

void CTaskOrgSet::DoFieldExchange(CDaoFieldExchange* pFX)
{
	//{{AFX_FIELD_MAP(CTaskOrgSet)
	pFX->SetFieldType(CDaoFieldExchange::outputColumn);
	DFX_Long(pFX, _T("[ID]"), m_ID);
	DFX_Long(pFX, _T("[ParentTaskID]"), m_ParentTaskID);
	DFX_Text(pFX, _T("[StartDateTime]"), m_StartDateTime);
	DFX_Text(pFX, _T("[StartPerson]"), m_StartPerson);
	DFX_Text(pFX, _T("[Topic]"), m_Topic);
	DFX_Text(pFX, _T("[Concerns]"), m_Concerns);
	DFX_Long(pFX, _T("[Priority]"), m_Priority);
	DFX_Text(pFX, _T("[Responsible]"), m_Responsible);
	DFX_Text(pFX, _T("[Description]"), m_Description);
	DFX_Text(pFX, _T("[Notes]"), m_Notes);
	DFX_Text(pFX, _T("[WaitFor]"), m_WaitFor);
	DFX_Text(pFX, _T("[Deadline]"), m_Deadline);
	DFX_Long(pFX, _T("[WarnBefore]"), m_WarnBefore);
	DFX_Long(pFX, _T("[WarnPeriod]"), m_WarnPeriod);
	DFX_Text(pFX, _T("[EndDateTime]"), m_EndDateTime);
	DFX_Text(pFX, _T("[EndPerson]"), m_EndPerson);
	DFX_Text(pFX, _T("[Status]"), m_Status);
	//}}AFX_FIELD_MAP
}

/////////////////////////////////////////////////////////////////////////////
// CTaskOrgSet diagnostics

#ifdef _DEBUG
void CTaskOrgSet::AssertValid() const
{
	CDaoRecordset::AssertValid();
}

void CTaskOrgSet::Dump(CDumpContext& dc) const
{
	CDaoRecordset::Dump(dc);
}
#endif //_DEBUG
